/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interface.Domicilios;

import LN.Varios.Hosteria;
import java.awt.GridLayout;
import javax.swing.BoxLayout;

/**
 *
 * @author Lukas
 */
public class SubMenu_Domicilios extends javax.swing.JPanel {

    /**
     * Creates new form SubMenu_Domicilios
     */
    public SubMenu_Domicilios(Hosteria unaHosteria) {
        this.unaHosteria = unaHosteria;
        initComponents();
        PNL_subCuerpo.setLayout(new BoxLayout(PNL_subCuerpo, BoxLayout.LINE_AXIS));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        BTN_Pais = new javax.swing.JButton();
        BTN_Provincia = new javax.swing.JButton();
        BTN_Localidad = new javax.swing.JButton();
        PNL_subCuerpo = new org.edisoncor.gui.panel.PanelCurves();

        setBackground(new java.awt.Color(153, 153, 153));

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jPanel1.setLayout(new java.awt.GridLayout());

        BTN_Pais.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/paissss.gif"))); // NOI18N
        BTN_Pais.setText("Países");
        BTN_Pais.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        BTN_Pais.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        BTN_Pais.setPreferredSize(new java.awt.Dimension(150, 58));
        BTN_Pais.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_PaisActionPerformed(evt);
            }
        });
        jPanel1.add(BTN_Pais);

        BTN_Provincia.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/misiones.png"))); // NOI18N
        BTN_Provincia.setText("Provincias");
        BTN_Provincia.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        BTN_Provincia.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        BTN_Provincia.setPreferredSize(new java.awt.Dimension(150, 58));
        BTN_Provincia.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_ProvinciaActionPerformed(evt);
            }
        });
        jPanel1.add(BTN_Provincia);

        BTN_Localidad.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagenes/ciudad.png"))); // NOI18N
        BTN_Localidad.setText("Localidades");
        BTN_Localidad.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        BTN_Localidad.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT);
        BTN_Localidad.setPreferredSize(new java.awt.Dimension(150, 58));
        BTN_Localidad.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_LocalidadActionPerformed(evt);
            }
        });
        jPanel1.add(BTN_Localidad);

        javax.swing.GroupLayout PNL_subCuerpoLayout = new javax.swing.GroupLayout(PNL_subCuerpo);
        PNL_subCuerpo.setLayout(PNL_subCuerpoLayout);
        PNL_subCuerpoLayout.setHorizontalGroup(
            PNL_subCuerpoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 636, Short.MAX_VALUE)
        );
        PNL_subCuerpoLayout.setVerticalGroup(
            PNL_subCuerpoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 396, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(PNL_subCuerpo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(PNL_subCuerpo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void BTN_PaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_PaisActionPerformed
        ABM_Pais gestorPais = new ABM_Pais(unaHosteria);
        PNL_subCuerpo.removeAll();
        PNL_subCuerpo.add(gestorPais);
        PNL_subCuerpo.updateUI();
    }//GEN-LAST:event_BTN_PaisActionPerformed

    private void BTN_ProvinciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_ProvinciaActionPerformed
        ABM_Provincia gestorProvincia = new ABM_Provincia(unaHosteria);
        PNL_subCuerpo.removeAll();
        PNL_subCuerpo.add(gestorProvincia);
        PNL_subCuerpo.updateUI();
    }//GEN-LAST:event_BTN_ProvinciaActionPerformed

    private void BTN_LocalidadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_LocalidadActionPerformed
        ABM_Localidad gestorLocalidad = new ABM_Localidad(unaHosteria);
        PNL_subCuerpo.removeAll();
        PNL_subCuerpo.add(gestorLocalidad);
        PNL_subCuerpo.updateUI();
    }//GEN-LAST:event_BTN_LocalidadActionPerformed
    private Hosteria unaHosteria;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BTN_Localidad;
    private javax.swing.JButton BTN_Pais;
    private javax.swing.JButton BTN_Provincia;
    private org.edisoncor.gui.panel.PanelCurves PNL_subCuerpo;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
